package com.caiheng.api.service.platfom.impl;

import com.caiheng.api.dao.platform.ErrorListMapper;
import com.caiheng.api.entity.platform.ErrorList;
import com.caiheng.api.service.base.impl.BaseServiceImpl;
import com.caiheng.api.service.platfom.ErrorListService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;

/**
 * 错误列Service业务层处理
 *
 * @author ruoyi
 * @date 2024-01-23
 */
@Service
public class ErrorListServiceImpl extends BaseServiceImpl<ErrorListMapper, ErrorList> implements ErrorListService {

    @Resource
    private ErrorListMapper errorListMapper;

    @Override
    public int addError(String title,String apiUrl,String errType, String content, String fromType) {

        ErrorList errorList = new ErrorList();
        errorList.setApiUrl(apiUrl);
        errorList.setErrorType(errType);
        errorList.setFromType(fromType);
        errorList.setTitle(title);
        errorList.setCreateTime(new Date());
        errorList.setErrorContent(content);
        return  errorListMapper.insert(errorList);
    }
}
